<template>
	<view>
		<view class="page" v-if="list.length > 0">
			<uni-collapse ref="collapse">
				<uni-collapse-item v-for="(item,index) in list" :key="index">
					<template v-slot:title>
						<view class="uni-collapse-item__title-box">
							<view class="question-num">
								Q{{index + 1}}
							</view>
							<text class="uni-collapse-item__title-text">{{item.title}}</text>
						</view>
					</template>
					<view class="content">
						<text class="text">{{item.content}}</text>
					</view>
				</uni-collapse-item>
			</uni-collapse>
		</view>

		<view v-else>
			<view class="empty" v-if="show">
				暂无数据
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				show: false
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				let _this = this
				_this.$api.get('meet.faq/index', {}).then(res => {
					if (res.code == 1) {
						_this.list = res.data.list
						_this.show = true
					}
				}, fail => {})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F6F6F6;
		padding-bottom: 40rpx;
	}

	.page {
		padding: 0 40rpx;
		background-color: #FFFFFF;
		margin-top: 16rpx;
	}

	.empty {
		display: flex;
		justify-content: center;
		margin-top: 50rpx;
		font-size: 30rpx;
	}

	.content {
		padding: 30rpx 40rpx 30rpx 92rpx;
	}

	.text {
		font-size: 24rpx;
		color: #666;
		line-height: 20px;
	}

	.question-num {
		width: 68rpx;
		height: 66rpx;
		background-position: center;
		background-size: cover;
		background-repeat: no-repeat;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #FFFFFF;
		font-size: 24rpx;
		padding-bottom: 10rpx;
		margin-right: 24rpx;
		background-color: #000;
	}

	.uni-collapse-item__title-wrap {
		padding: 10rpx 0;
	}

	.uni-collapse-item__title-text {
		font-size: 28rpx !important;
		color: #333333 !important;
		font-weight: bold;
		flex: 1;
		white-space: nowrap;
		color: inherit;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.uni-collapse-item__title-box {
		padding: 0 30rpx 0 0 !important;
		display: flex;
		width: 100%;
		box-sizing: border-box;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		height: 48px;
		line-height: 48px;
		background-color: #fff;
		color: #303133;
		font-size: 13px;
		font-weight: 500;
	}
</style>